package com.ls.aop.cglib;

import java.lang.reflect.Method;

import org.mockito.cglib.proxy.MethodInterceptor;
import org.mockito.cglib.proxy.MethodProxy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyCglibIntercepter implements MethodInterceptor{
	private Logger logger = LoggerFactory.getLogger(this.getClass());

	@Override
	public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
		logger.info("before cglib called");
		Object obj2 = proxy.invokeSuper(obj, args);
		logger.info("after cglib called");
		return obj2;
	}

}
